package com.lp.gps_alarm_tests;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import com.lp.gps_alarm_classes.RingPoi;

public class RingPoiTest {
	
	private RingPoi ringPoi1;
	private RingPoi ringPoi2;
	

	@Before
	public void setUp() throws Exception {
		ringPoi1 = new RingPoi();	// default-Werte
		ringPoi2 = new RingPoi();	// eigene Werte
		ringPoi2.setxCurrentCoordinate(1.23);
		ringPoi2.setyCurrentCoordinate(34.234343);
	}

	@Test
	public void testRingPoi() {
		RingPoi rp = new RingPoi();
		assertNotNull(rp);
		assertEquals(47.666327, rp.getxCurrentCoordinate(), 0);
		assertEquals(9.217615, rp.getyCurrentCoordinate(), 0);
	}

	@Test
	public void testGetxCurrentCoordinate() {
		assertEquals(47.666327, ringPoi1.getxCurrentCoordinate(), 0);
		assertEquals(1.23, ringPoi2.getxCurrentCoordinate(), 0);
	}

	@Test
	public void testSetxCurrentCoordinate() {
		ringPoi1.setxCurrentCoordinate(2.46);
		assertEquals(2.46, ringPoi1.getxCurrentCoordinate(), 0);
	}

	@Test
	public void testGetyCurrentCoordinate() {
		assertEquals(9.217615, ringPoi1.getyCurrentCoordinate(), 0);
		assertEquals(34.234343, ringPoi2.getyCurrentCoordinate(), 0);
	}

	@Test
	public void testSetyCurrentCoordinate() {
		ringPoi1.setyCurrentCoordinate(70.1);
		assertEquals(70.1, ringPoi1.getyCurrentCoordinate(), 0);
	}

}
